<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateTableCityTerritorialBoundary extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('city_territorial_boundary', function (Blueprint $table) {
            $table->id();

            $table->string("pAdcode", 6)->comment("父级adcode")->default("");
            $table->string("adcode", 6)->comment("adcode")->default("");
            $table->string("cityCode", 4)->comment("cityCode")->default("");
            $table->string("name")->comment("名称")->default("");
            $table->string("level")->comment("城市等级")->default("");
            $table->string("centerLongitude")->comment("经度")->default("");
            $table->string("centerLatitude")->comment("纬度")->default("");
            $table->longText("polyline")->comment("边界信息")->default("");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '高德城市边界表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('city_territorial_boundary');
    }
}
